import service from "@/utils/axios"

// 多语言文本类型
export interface TextI18n {
  zh: string
  en: string
  ar: string
}

// 新增礼物请求参数
export interface GiftAddReq {
  id?: string
  name: TextI18n
  coin: number
  previewImageUrl: string
  animationImageUrl: string
  sort: number
  giftType: string
  desc: TextI18n
  label: string[]
  enable: boolean
}

// 编辑礼物请求参数
export interface GiftUpdateReq {
  id: string
  name: TextI18n
  coin: number
  previewImageUrl: string
  animationImageUrl: string
  sort: number
  giftType: string
  desc: TextI18n
  label: string[]
  enable: boolean
}

// 新增礼物
export const addGiftApi = (data: GiftAddReq) => {
  return service.post("/gift", data)
}

// 编辑礼物
export const updateGiftApi = (id: string, data: GiftUpdateReq) => {
  return service.post(`/gift/${id}/update`, data)
}

// 删除礼物
export const deleteGiftApi = (id: string) => {
  return service.delete(`/gift/${id}`)
}

// 获取礼物详情
export const getGiftDetailApi = (id: string) => {
  return service.get(`/gift/${id}`)
} 